package pers.jason.wppm.auth.api.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import pers.jason.wppm.api.support.Regular;

import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @ClassName: UserInsertCondition
 * @Author: JZH
 * @Date: 2018/12/26 13:33
 *
 * 用户注册传输对象
 */
@Data
public class UserInsertCondition {

    private String userId;

    @ApiModelProperty(value = "登录名")
    @NotBlank(message = "登录名不能为空")
    @Size(min = 2, max = 32, message = "登录名长度在2~32之间")
    private String loginName;

    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty(value = "姓名")
    @Size(min = 2, max = 32, message = "姓名长度在2~32之间")
    private String userName;

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = Regular.REP_MOBILE, message = "手机号码格式错误")
    private String mobile;

    @ApiModelProperty(value = "密码")
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 32, message = "密码长度在6~32之间")
    private String password;

    @ApiModelProperty(value = "性别")
    private Boolean gender;

    @ApiModelProperty(value = "头像url")
    private String headImg;

    @ApiModelProperty(value = "生日")
    @Past(message = "生日必须是历史时间")
    private Date birthday;

    @Email(message = "邮箱格式错误")
    @ApiModelProperty(value = "邮箱")
    private String email;

    private Boolean isAccountNonExpired = true;

    private Boolean isAccountNonLocked = true;

    private Boolean isCredentialsNonExpired = true;

    private Boolean isEnable = true;

    private Boolean isEmailPublic = false;

    private Boolean isMobilePublic = false;

    private Date lastLoginTime;

    private Date createTime = new Date();



}
